<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
	<title>Facebook contest app</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="http://slopetracker.vn/wp-content/themes/stvn/images/slope.ico?m=1285358655g" sizes="16x16 32x32 48x48" />
        <link rel="shortcut icon" type="image/x-icon" href="http://slopetracker.vn/wp-content/themes/stvn/images/favicon.ico?m=1285358655g" sizes="16x16" />
        <link rel="icon" type="image/x-icon" href="http://slopetracker.vn/wp-content/themes/stvn/images/favicon.ico?m=1285358655g" sizes="16x16" />
        <script type="text/javascript" src="../libs/js/jquery.min.js"></script>        
        <script type="text/javascript" src="../libs/js/jquery.blockUI.js"></script>
        <script type="text/javascript">
            jQuery.noConflict();
        </script>  
        <script type="text/javascript" src="assets/js/contest.js"></script>  
</head>
    <body>
        <div id="fb-root"></div>
        <script src="https://connect.facebook.net/en_US/all.js"></script>
        <script type="text/javascript" charset="utf-8">            
            FB.init({
                appId  : '<?php echo $view->config['facebook_app_id'];?>',
                status : true, // check login status
                cookie : true, // enable cookies to allow the server to access the session
                xfbml  : true, // parse XFBML
                //channelURL : 'http://ssl.socialmediatoolbox.no/coupon/calendar/channel.html', // channel.html file
                oauth  : true // enable OAuth 2.0
            });
            
            FB.UIServer.setLoadedNode = function (a, b){FB.UIServer._loadedNodes[a.id] = b; }
            FB.getLoginStatus(function(response) {
                if (response.authResponse) {
                    
                } else {

                }
            });
        </script>
        <h1>Facebook contest application</h1>
        <a href="?action=index">Home</a> |         
        <a href="?action=vote">Vote</a> | 
        <a href="?action=vote&order=total_like&sort=desc&limit=10">Top 10</a> 
        <span>
        <?php if($view->isLogined){ ?>
            | Hello <b><?php echo $view->user['first_name']; ?></b> (<i><a style="color:red;" href="?action=logout">Logout</a></i>)
        <?php } else { ?>
            | <a href="?action=register">Register</a>
            | <i><a href="?action=login">Login</a></i>
        <?php } ?>
        </span>
        <br/><br/>
        <!-- set up the javascript variables --> 
        <script type="text/javascript">
            <?php if($view->isConnectedFacebook) {?>
                contestapp.isConnectedFacebook = true;
            <?php } ?>
        </script>
        
        <?php echo $view->view_content; ?>
        
        <hr/>
<i>Copyright SlopeTracker 2012</i>
</body>
</html>